<script type="text/javascript">
	var baseUrl = "<?=url::base()?>";
</script>
<?=html::script('js/funs.js')?>
<?=html::script('js/validator.js')?>
<div id="header">
	<div id="logo"><?=html::image('images/logo.gif')?><?=html::image('images/banner.gif')?></div>
	<div id="home-login">
		<?php if(cookie::get('userid')) { ?>
			<div style="height:45px;text-align:right;">Welcome, <?=html::anchor('user/index', cookie::get('firstname').' '.cookie::get('lastname'))?>! &#160;&#160;<?=html::anchor('customer/logout', 'Log Out')?></div>
		<?php } else { ?>
		<form id="home-login-form" method="post" action="<?=url::site('customer/checklogin')?>">
			<label for="username"><?=Kohana::lang('site.username')?>: </label><input type="text" name="username" dataType="ASCII" msg="用户名只能包含英文字母和数字"/><br/>
			<label for="password"><?=Kohana::lang('site.password')?>: </label><input type="password" name="password" dataType="Require" msg="请输入密码"/>
			<a onclick="if(Validator.Validate($('home-login-form'),2)){$('home-login-form').submit();}"><?=Kohana::lang('site.login')?></a>
		</form>
		<?php } ?>
		<div id="home-reg"><?=html::anchor('customer/forgotpassword', Kohana::lang('site.forgotpass').'?')?><?=html::anchor('customer/register', Kohana::lang('site.register'))?></div>
	</div>
</div>
<div id="top-menu">
	<div class="menu">
		<ul><li><?=html::anchor('', Kohana::lang('site.home'))?></li>
		<li class="separator"></li>
		<li><?=html::anchor('static/aboutnanhai', Kohana::lang('site.aboutnanhai'))?></li>
		<li class="separator"></li>
		<li><?=html::anchor('static/contactus', Kohana::lang('site.contactus'))?></li>
		<li class="separator"></li>
		<li><?=html::anchor('static/jobs', Kohana::lang('site.jobs'))?></li>
		<li class="separator"></li>
		<li><?=html::anchor('bookstore', Kohana::lang('site.bookstore'))?></li></ul>
	</div>
	<div id="lang">
		<?=html::anchor('common/setlang/cn', '中文', ($this->lang=='cn') ? array('class'=>"curr") : '')?>
		<?=html::anchor('common/setlang/en', 'English', ($this->lang=='en') ? array('class'=>"curr") : '')?>
	</div>
</div>
<?php if(Router::$controller != 'cart' and Router::$controller != 'order') { ?>
<div id="main-nav">	
<?php if(Router::$controller == 'welcome') { ?>
<script type="text/javascript"> 
	insertFlash('main-nav', "<?=url::base()?>images/swf/intro_<?=$this->lang?>.swf", 988, 165);
</script>
<?php } else { ?>
	<a href="<?=url::site('education')?>"><?=html::image('images/'.$this->lang.'/main_nav_1.jpg')?></a>
	<a href="<?=url::site('culture')?>"><?=html::image('images/'.$this->lang.'/main_nav_2.jpg')?></a>
	<a href="<?=url::site('bookstore')?>"><?=html::image('images/'.$this->lang.'/main_nav_3.jpg')?></a>
	<a href="<?=url::site('calender/index/'.date('n').'/'.date('Y'))?>"><?=html::image('images/'.$this->lang.'/main_nav_4.jpg')?></a>
	<?=html::anchor('forum', html::image('images/'.$this->lang.'/main_nav_5.jpg'))?>
<?php } ?>
</div>
<?php } ?>
